/*------------------------------------------------------------------------------

Publication: Schakel, W. (2020) Representing the Rich: Economic and Political
	Inequality in Established Democracies. University of Amsterdam: Doctoral
	Dissertation.

Chapter: 3

Description: This do-file runs the analyses presented in the results section of
	chapter 3.

Sections:

	1. Main analyses
	2. Online appendices (robustness checks)
	3. Descriptive representation

Data:

	- Schakel_2020_Chapter3_1_Data (for sections 1 and 2; see
	  Schakel_2020_Chapter3_1_Preparation do-file for original sources)
	- European Social Survey, waves 1-6 (for section 3)
	- Section 3 also uses data from the research project Pathways to Power and
	  from the Dutch Parliament Study. See section 3 for a further note on
	  these sources.

------------------------------------------------------------------------------*/

global data "YOUR PATH HERE"

use "$data\Schakel_2020_Chapter3_1_Data.dta", clear

/*------------------------------------------------------------------------------
 1. Main analyses
------------------------------------------------------------------------------*/

* These variables are used in several models
gen diff_i10=abs(i10-i90)
gen diff_i50=abs(i50-i90)

recode i10 i50 i90 (0/50=0) (50/100=1), prefix(d)

* Instances where majorities of low and high incomes are on different sides
tab di10 di90 if pass!=., cell nofreq matcell(m_i)
display (m_i[1,2]+m_i[2,1])/r(N)

* Table 1 (basic models)
logistic pass i10
logistic pass i50
logistic pass i90

* Table 2 (models incorporating differences in opinions)
logistic pass i10 if diff_i10>10
logistic pass i90 if diff_i10>10

logistic pass i50 if diff_i50>10
logistic pass i90 if diff_i50>10

* Table 3 (majority win rates)
gen favori1090=10 if di10>di90
replace favori1090=90 if di10<di90

gen favori5090=50 if di50>di90
replace favori5090=90 if di50<di90

tab favori1090 pass, matcell(wr_i10)
display (wr_i10[1,2]+wr_i10[2,1])/r(N)

tab favori5090 pass, matcell(wr_i50)
display (wr_i50[1,2]+wr_i50[2,1])/r(N)

drop favor*

* Table 4 (controling for education)
logistic pass i10e10
logistic pass i10e50
logistic pass i10e90
logistic pass i50e10
logistic pass i50e50
logistic pass i50e90
logistic pass i90e10
logistic pass i90e50
logistic pass i90e90

* Significant differences between coefficients in table 4
preserve
recode i10e10 i90e10 (.=.), gen(v1 v2)
gen diff=abs(v1-v2)
keep v1 v2 diff pass
gen id=_n
reshape long v, i(id) j(d)
logistic pass c.v##i.d // the interaction term denotes the significance
logistic pass c.v##i.d if diff>10
restore

* Voting
logistic pass i50v
logistic pass i50nv
logistic pass i90nv i10v

/*------------------------------------------------------------------------------
 2. Online appendices (robustness checks)
------------------------------------------------------------------------------*/

* Table C1 (models with preference gaps)
logistic pass c.i10##c.diff_i10
logistic pass c.i90##c.diff_i10
logistic pass c.i50##c.diff_i50
logistic pass c.i90##c.diff_i50

* Table D1 (macro-level controls)
logistic pass i10 unempt growtht debtt lrgovt
logistic pass i50 unempt growtht debtt lrgovt
logistic pass i90 unempt growtht debtt lrgovt

* Table D2 (macro-level controls)
logistic pass c.i10##c.diff_i10 unempt growtht debtt lrgovt
logistic pass c.i90##c.diff_i10 unempt growtht debtt lrgovt
logistic pass c.i50##c.diff_i50 unempt growtht debtt lrgovt
logistic pass c.i90##c.diff_i50 unempt growtht debtt lrgovt

* Macro-level controls measured as the average over t - t+4
logistic pass i10 unempt4 growtht4 debtt4 lrgovt4
logistic pass i50 unempt4 growtht4 debtt4 lrgovt4
logistic pass i90 unempt4 growtht4 debtt4 lrgovt4

logistic pass c.i10##c.diff_i10 unempt4 growtht4 debtt4 lrgovt4
logistic pass c.i90##c.diff_i10 unempt4 growtht4 debtt4 lrgovt4
logistic pass c.i50##c.diff_i50 unempt4 growtht4 debtt4 lrgovt4
logistic pass c.i90##c.diff_i50 unempt4 growtht4 debtt4 lrgovt4

* Table D3 (year dummies)
logistic pass i10 i.year
logistic pass i50 i.year
logistic pass i90 i.year

* Table D4 (year dummies)
logistic pass c.i10##c.diff_i10 i.year
logistic pass c.i90##c.diff_i10 i.year
logistic pass c.i50##c.diff_i50 i.year
logistic pass c.i90##c.diff_i50 i.year

* Table D5 (survey organization dummies)
logistic pass i10 i.survey
logistic pass i50 i.survey
logistic pass i90 i.survey

* Table D6 (survey organization dummies)
logistic pass c.i10##c.diff_i10 i.survey
logistic pass c.i90##c.diff_i10 i.survey
logistic pass c.i50##c.diff_i50 i.survey
logistic pass c.i90##c.diff_i50 i.survey

* Jackknife with survey organizations
forval i=1/8 {
	logistic pass i10 if survey!=`i'
	logistic pass i50 if survey!=`i'
	logistic pass i90 if survey!=`i'

	logistic pass c.i10##c.diff_i10 if survey!=`i'
	logistic pass c.i90##c.diff_i10 if survey!=`i'
	logistic pass c.i50##c.diff_i50 if survey!=`i'
	logistic pass c.i90##c.diff_i50 if survey!=`i'
	}

* Table D7 (excluding spending questions)
logistic pass i10 if spending==0
logistic pass i50 if spending==0
logistic pass i90 if spending==0

* Table D8 (excluding spending questions)
logistic pass c.i10##c.diff_i10 if spending==0
logistic pass c.i90##c.diff_i10 if spending==0
logistic pass c.i50##c.diff_i50 if spending==0
logistic pass c.i90##c.diff_i50 if spending==0

* Table D9 (excluding outliers)
logistic pass i10 if diff_i10>10 & diff_i10<25
logistic pass i90 if diff_i10>10 & diff_i10<25
logistic pass i50 if diff_i50>10 & diff_i50<25
logistic pass i90 if diff_i50>10 & diff_i50<25

* Other measurements of low and high income
gen diff_i05=abs(i05-i95)
gen diff_i20=abs(i20-i80)
gen diff_i50_v2=abs(i50-i80)
gen diff_i50_v3=abs(i50-i95)

logistic pass i05
logistic pass i20
logistic pass i80
logistic pass i95

* Table D10 (20th and 80th percentiles)
logistic pass c.i20##c.diff_i20
logistic pass c.i80##c.diff_i20
logistic pass c.i50##c.diff_i50_v2
logistic pass c.i80##c.diff_i50_v2

* Table D11 (5th and 95th percentiles)
logistic pass c.i05##c.diff_i05
logistic pass c.i95##c.diff_i05
logistic pass c.i50##c.diff_i50_v3
logistic pass c.i95##c.diff_i50_v3

* Table D12 (OLS with robust standard errors)
reg pass i10, vce(rob)
reg pass i50, vce(rob)
reg pass i90, vce(rob)

* Table D13 (OLS with robust standard errors)
reg pass c.i10##c.diff_i10, vce(rob)
reg pass c.i90##c.diff_i10, vce(rob)
reg pass c.i50##c.diff_i50, vce(rob)
reg pass c.i90##c.diff_i50, vce(rob)

* Table D14 (probit)
probit pass i10
probit pass i50
probit pass i90

* Table D15 (probit)
probit pass c.i10##c.diff_i10
probit pass c.i90##c.diff_i10
probit pass c.i50##c.diff_i50
probit pass c.i90##c.diff_i50

* Table D16 (clustered standard errors)
logistic pass i10, vce(cluster year)
logistic pass i50, vce(cluster year)
logistic pass i90, vce(cluster year)

* Table D17 (clustered standard errors)
logistic pass c.i10##c.diff_i10, vce(cluster year)
logistic pass c.i90##c.diff_i10, vce(cluster year)
logistic pass c.i50##c.diff_i50, vce(cluster year)
logistic pass c.i90##c.diff_i50, vce(cluster year)

/*------------------------------------------------------------------------------
 3. Descriptive representation
------------------------------------------------------------------------------*/

/* This is the analysis of the association between socio-economic status
and political views on the mass level.

Note: download wave 1-6 of the Netherlands in the European Social Survey's
cumulative data wizard (https://www.europeansocialsurvey.org/downloadwizard/).
Select the variables 'gincdif', 'euftf' and 'imueclt' under 'Politics' and
select 'iscoco' and 'isco08' under 'Socio-demographic profile'. */

use "$data\ESS1-7e01.dta", clear

* The ISCO-1988 categories are recoded into socio-economic status in accordance
* with Ganzeboom's classification (http://www.harryganzeboom.nl/isco88/index.htm)
recode iscoco (1000=55) (1100=70) (1110=77) (1120=77) (1130=66) (1140=58)	///
	(1141=58) (1142=58) (1143=58) (1200=68) (1210=70) (1220=67) (1221=67)	///
	(1222=67) (1223=67) (1224=59) (1225=59) (1226=59) (1227=87) (1228=59)	///
	(1229=67) (1230=61) (1231=69) (1232=69) (1233=56) (1234=69) (1235=69)	///
	(1236=69) (1237=69) (1239=69) (1240=58) (1250=64) (1251=70) (1252=60)	///
	(1300=51) (1310=51) (1311=43) (1312=56) (1313=51) (1314=49) (1315=44)	///
	(1316=51) (1317=51) (1318=51) (1319=51) (2000=70) (2100=69) (2110=74)	///
	(2111=74) (2112=74) (2113=74) (2114=74) (2120=71) (2121=71) (2122=71)	///
	(2130=71) (2131=71) (2132=71) (2139=71) (2140=73) (2141=69) (2142=69)	///
	(2143=68) (2144=68) (2145=67) (2146=71) (2147=67) (2148=56) (2149=69)	///
	(2200=80) (2210=78) (2211=77) (2212=77) (2213=79) (2220=85) (2221=88)	///
	(2222=85) (2223=83) (2224=74) (2229=85) (2230=43) (2300=69) (2310=77)	///
	(2320=69) (2321=70) (2322=66) (2330=66) (2331=66) (2332=43) (2340=66)	///
	(2350=66) (2351=70) (2352=70) (2359=65) (2400=68) (2410=69) (2411=69)	///
	(2412=69) (2419=69) (2420=85) (2421=85) (2422=90) (2429=82) (2430=65)	///
	(2431=65) (2432=65) (2440=65) (2441=78) (2442=71) (2443=71) (2444=65)	///
	(2445=71) (2446=51) (2450=61) (2451=65) (2452=54) (2453=64) (2454=64)	///
	(2455=64) (2460=53) (3000=54) (3100=50) (3110=49) (3111=45) (3112=45)	///
	(3113=46) (3114=46) (3115=54) (3116=54) (3117=54) (3118=51) (3119=53)	///
	(3120=52) (3121=52) (3122=52) (3123=52) (3130=52) (3131=48) (3132=57)	///
	(3133=57) (3139=52) (3140=57) (3141=52) (3142=52) (3143=69) (3144=69)	///
	(3145=50) (3150=50) (3151=50) (3152=50) (3200=48) (3210=50) (3211=50)	///
	(3212=50) (3213=50) (3220=55) (3221=51) (3222=51) (3223=51) (3224=60)	///
	(3225=51) (3226=60) (3227=51) (3228=51) (3229=51) (3230=38) (3231=38)	///
	(3232=38) (3240=49) (3241=51) (3242=38) (3300=38) (3310=38) (3320=38)	///
	(3330=38) (3340=38) (3400=55) (3410=55) (3411=61) (3412=54) (3413=59)	///
	(3414=56) (3415=56) (3416=50) (3417=56) (3419=55) (3420=55) (3421=55)	///
	(3422=55) (3423=55) (3429=55) (3430=54) (3431=54) (3432=59) (3433=51)	///
	(3434=61) (3439=54) (3440=56) (3441=56) (3442=57) (3443=56) (3444=46)	///
	(3449=56) (3450=56) (3451=55) (3452=56) (3460=43) (3470=52) (3471=53)	///
	(3472=64) (3473=50) (3474=50) (3475=54) (3480=38) (4000=45) (4100=45)	///
	(4110=51) (4111=51) (4112=50) (4113=50) (4114=51) (4115=53) (4120=51)	///
	(4121=51) (4122=51) (4130=36) (4131=32) (4132=43) (4133=45) (4140=39)	///
	(4141=39) (4142=39) (4143=39) (4144=39) (4190=39) (4200=49) (4210=48)	///
	(4211=53) (4212=46) (4213=40) (4214=40) (4215=40) (4220=52) (4221=52)	///
	(4222=52) (4223=52) (5000=40) (5100=38) (5110=34) (5111=34) (5112=34)	///
	(5113=34) (5120=32) (5121=30) (5122=30) (5123=34) (5130=25) (5131=25)	///
	(5132=25) (5133=25) (5139=25) (5140=30) (5141=29) (5142=19) (5143=54)	///
	(5149=19) (5150=43) (5151=43) (5152=43) (5160=47) (5161=42) (5162=50)	///
	(5163=40) (5164=40) (5169=40) (5200=43) (5210=43) (5220=43) (5230=37)	///
	(6000=23) (6100=23) (6110=23) (6111=23) (6112=23) (6113=23) (6114=23)	///
	(6120=23) (6121=23) (6122=23) (6123=23) (6124=23) (6129=23) (6130=23)	///
	(6131=23) (6132=27) (6133=28) (6134=28) (6140=22) (6141=22) (6142=22)	///
	(6150=28) (6151=28) (6152=28) (6153=28) (6154=28) (6200=16) (6210=16)	///
	(7000=34) (7100=31) (7110=30) (7111=30) (7112=30) (7113=27) (7120=30)	///
	(7121=29) (7122=29) (7123=26) (7124=29) (7129=30) (7130=34) (7131=19)	///
	(7132=30) (7133=31) (7134=34) (7135=26) (7136=33) (7137=37) (7140=29)	///
	(7141=29) (7142=32) (7143=29) (7200=34) (7210=31) (7211=29) (7212=30)	///
	(7213=33) (7214=30) (7215=30) (7216=30) (7220=35) (7221=33) (7222=40)	///
	(7223=34) (7224=24) (7230=34) (7231=34) (7232=42) (7233=33) (7234=23)	///
	(7240=40) (7241=40) (7242=39) (7243=41) (7244=40) (7245=38) (7300=34)	///
	(7310=38) (7311=38) (7312=38) (7313=38) (7320=28) (7321=27) (7322=29)	///
	(7323=29) (7324=29) (7330=29) (7331=29) (7332=29) (7340=40) (7341=40)	///
	(7342=40) (7343=42) (7344=40) (7345=37) (7346=38) (7400=33) (7410=30)	///
	(7411=30) (7412=31) (7413=30) (7414=30) (7415=30) (7416=30) (7420=33)	///
	(7421=33) (7422=33) (7423=33) (7424=33) (7430=36) (7431=29) (7432=29)	///
	(7433=45) (7434=36) (7435=36) (7436=33) (7437=28) (7440=31) (7441=31)	///
	(7442=31) (7500=42) (7510=42) (7520=39) (7530=26) (8000=31) (8100=30)	///
	(8110=35) (8111=35) (8112=35) (8113=35) (8120=30) (8121=31) (8122=30)	///
	(8123=28) (8124=30) (8130=22) (8131=22) (8139=22) (8140=27) (8141=27)	///
	(8142=27) (8143=27) (8150=35) (8151=35) (8152=35) (8153=35) (8154=35)	///
	(8155=35) (8159=35) (8160=32) (8161=33) (8162=27) (8163=33) (8170=26)	///
	(8171=26) (8172=26) (8200=32) (8210=36) (8211=36) (8212=30) (8220=30)	///
	(8221=30) (8222=30) (8223=30) (8224=30) (8229=30) (8230=30) (8231=30)	///
	(8232=30) (8240=29) (8250=38) (8251=38) (8252=38) (8253=38) (8260=30)	///
	(8261=29) (8262=29) (8263=32) (8264=24) (8265=32) (8266=32) (8269=32)	///
	(8270=29) (8271=29) (8272=29) (8273=29) (8274=29) (8275=29) (8276=29)	///
	(8277=29) (8278=29) (8279=29) (8280=31) (8281=30) (8282=34) (8283=34)	///
	(8284=30) (8285=30) (8286=30) (8290=26) (8300=32) (8310=36) (8311=41)	///
	(8312=32) (8320=34) (8321=30) (8322=30) (8323=30) (8324=34) (8330=26)	///
	(8331=26) (8332=26) (8333=28) (8334=28) (8340=32) (8400=24) (9000=20)	///
	(9100=25) (9110=29) (9111=29) (9112=28) (9113=29) (9120=28) (9130=16)	///
	(9131=16) (9132=16) (9133=16) (9140=23) (9141=23) (9142=23) (9150=27)	///
	(9151=25) (9152=27) (9153=27) (9160=23) (9161=23) (9162=23) (9200=16)	///
	(9210=16) (9211=16) (9212=16) (9213=16) (9300=23) (9310=21) (9311=21)	///
	(9312=21) (9313=21) (9320=20) (9321=20) (9322=24) (9330=29) (9331=22)	///
	(9332=22) (9333=30) (100 2470 7139=.), gen(isei)

* The ISCO-2008 categories are recoded into socio-economic status in accordance
* with Ganzeboom's classification (http://www.harryganzeboom.nl/isco08/index.htm)
recode isco08 (0=51.25) (100=60.92) (110=60.92) (200=51.63) (210=51.63)		///
	(300=29.18) (310=29.18) (1000=65.12) (1100=71.72) (1110=74.50)			///
	(1111=68.77) (1112=78.76) (1113=64.98) (1114=71.29) (1120=70.34)		///
	(1200=72.94) (1210=72.24) (1211=73.38) (1212=74.79) (1213=70.57)		///
	(1219=68.54) (1220=73.71) (1221=71.39) (1222=75.25) (1223=81.92)		///
	(1300=65.25) (1310=49.48) (1311=49.48) (1312=49.48) (1320=61.57)		///
	(1321=65.42) (1322=61.57) (1323=59.89) (1324=58.07) (1330=78.86)		///
	(1340=65.01) (1341=65.01) (1342=65.01) (1343=65.01) (1344=65.01)		///
	(1345=65.01) (1346=65.01) (1349=65.01) (1400=51.01) (1410=43.85)		///
	(1411=43.85) (1412=43.85) (1420=51.56) (1430=51.01) (1431=51.01)		///
	(1439=51.01) (2000=76.24) (2100=79.49) (2110=84.16) (2111=84.61)		///
	(2112=84.61) (2113=83.50) (2114=86.81) (2120=81.78) (2130=80.46)		///
	(2131=80.46) (2132=78.17) (2133=80.46) (2140=79.05) (2141=79.05)		///
	(2142=81.40) (2143=79.05) (2144=77.10) (2145=82.31) (2146=79.31)		///
	(2149=78.69) (2150=80.75) (2151=80.78) (2152=80.75) (2153=80.75)		///
	(2160=79.74) (2161=79.74) (2162=79.74) (2163=79.74) (2164=79.74)		///
	(2165=72.96) (2166=79.74) (2200=76.98) (2210=88.70) (2211=88.70)		///
	(2212=81.92) (2220=68.70) (2221=68.70) (2222=68.70) (2230=76.98)		///
	(2240=76.98) (2250=84.14) (2260=75.43) (2261=88.31) (2262=81.13)		///
	(2263=75.43) (2264=67.94) (2265=65.23) (2266=75.43) (2267=75.43)		///
	(2269=75.43) (2300=75.54) (2310=85.41) (2320=72.30) (2330=82.41)		///
	(2340=71.45) (2341=76.49) (2342=58.77) (2350=68.88) (2351=77.88)		///
	(2352=70.89) (2353=68.88) (2354=68.88) (2355=68.88) (2356=68.88)		///
	(2359=66.42) (2400=73.91) (2410=75.50) (2411=76.65) (2412=75.50)		///
	(2413=75.50) (2420=70.09) (2421=70.09) (2422=72.94) (2423=68.55)		///
	(2424=70.09) (2430=73.91) (2431=73.91) (2432=73.91) (2433=73.91)		///
	(2434=73.91) (2500=75.13) (2510=74.66) (2511=74.66) (2512=74.66)		///
	(2513=74.66) (2514=74.66) (2519=74.70) (2520=75.13) (2521=75.13)		///
	(2522=75.13) (2523=75.13) (2529=75.13) (2600=75.67) (2610=85.13)		///
	(2611=86.72) (2612=88.96) (2619=81.05) (2620=71.55) (2621=77.19)		///
	(2622=70.40) (2630=77.24) (2631=80.92) (2632=83.09) (2633=83.81)		///
	(2634=85.85) (2635=70.50) (2636=71.55) (2640=72.83) (2641=72.83)		///
	(2642=72.83) (2643=80.92) (2650=63.31) (2651=61.82) (2652=64.44)		///
	(2653=61.82) (2654=63.31) (2655=70.10) (2656=54.00) (2659=37.59)		///
	(3000=56.03) (3100=52.40) (3110=53.60) (3111=55.03) (3112=59.35)		///
	(3113=51.92) (3114=56.38) (3115=53.77) (3116=59.45) (3117=62.79)		///
	(3118=50.73) (3119=51.35) (3120=38.18) (3121=37.83) (3122=40.54)		///
	(3123=37.83) (3130=33.66) (3131=46.73) (3132=37.22) (3133=33.66)		///
	(3134=33.66) (3135=33.66) (3139=31.46) (3140=54.86) (3141=54.86)		///
	(3142=58.05) (3143=54.86) (3150=63.29) (3151=56.41) (3152=52.70)		///
	(3153=73.71) (3154=69.24) (3155=67.04) (3200=55.40) (3210=54.92)		///
	(3211=57.04) (3212=57.37) (3213=48.66) (3214=54.92) (3220=56.98)		///
	(3221=56.00) (3222=51.93) (3230=51.57) (3240=24.79) (3250=53.15)		///
	(3251=47.83) (3252=53.15) (3253=53.15) (3254=59.85) (3255=53.15)		///
	(3256=44.92) (3257=57.25) (3258=53.15) (3259=61.91) (3300=57.64)		///
	(3310=57.13) (3311=72.27) (3312=59.76) (3313=55.25) (3314=69.76)		///
	(3315=57.68) (3320=57.97) (3321=60.29) (3322=57.03) (3323=56.35)		///
	(3324=61.18) (3330=56.64) (3331=54.62) (3332=56.64) (3333=60.44)		///
	(3334=62.39) (3339=59.89) (3340=57.99) (3341=62.13) (3342=57.99)		///
	(3343=54.55) (3344=57.99) (3350=61.60) (3351=65.64) (3352=67.11)		///
	(3353=54.27) (3354=59.18) (3355=63.03) (3359=64.40) (3400=52.57)		///
	(3410=54.35) (3411=57.00) (3412=52.72) (3413=54.54) (3420=50.90)		///
	(3421=50.90) (3422=50.90) (3423=50.90) (3430=50.15) (3431=50.15)		///
	(3432=57.64) (3433=50.15) (3434=50.15) (3435=50.15) (3500=60.93)		///
	(3510=62.45) (3511=61.07) (3512=62.45) (3513=62.45) (3514=62.45)		///
	(3520=56.50) (3521=56.57) (3522=56.50) (4000=43.51) (4100=43.33)		///
	(4110=43.33) (4120=44.94) (4130=44.87) (4131=48.27) (4132=40.56)		///
	(4200=41.22) (4210=43.06) (4211=48.10) (4212=48.82) (4213=50.05)		///
	(4214=50.05) (4220=39.02) (4221=49.30) (4222=39.02) (4223=38.58)		///
	(4224=39.02) (4225=39.02) (4226=39.02) (4227=39.02) (4229=39.02)		///
	(4300=44.08) (4310=50.57) (4311=50.37) (4312=57.38) (4313=50.57)		///
	(4320=36.10) (4321=32.50) (4322=41.63) (4323=41.27) (4400=42.30)		///
	(4410=42.30) (4411=42.30) (4412=27.52) (4413=51.77) (4414=54.67)		///
	(4415=42.30) (4416=42.30) (4419=44.72) (5000=29.32) (5100=27.57)		///
	(5110=45.46) (5111=46.76) (5112=38.44) (5113=47.42) (5120=24.53)		///
	(5130=25.04) (5131=25.04) (5132=25.04) (5140=31.08) (5141=31.08)		///
	(5142=31.08) (5150=25.46) (5151=25.20) (5152=32.20) (5153=21.82)		///
	(5160=30.59) (5161=32.75) (5162=24.07) (5163=34.25) (5164=30.59)		///
	(5165=30.59) (5169=32.75) (5200=29.73) (5210=26.64) (5211=28.84)		///
	(5212=23.53) (5220=29.47) (5221=35.34) (5222=44.14) (5223=28.48)		///
	(5230=30.90) (5240=39.04) (5241=39.73) (5242=39.04) (5243=39.04)		///
	(5244=38.88) (5245=39.04) (5246=39.04) (5249=39.04) (5300=25.09)		///
	(5310=24.98) (5311=24.98) (5312=24.98) (5320=26.64) (5321=26.64)		///
	(5322=21.64) (5329=26.64) (5400=36.86) (5410=36.86) (5411=46.38)		///
	(5412=51.50) (5413=48.13) (5414=23.80) (5419=33.83) (6000=19.20)		///
	(6100=19.41) (6110=16.34) (6111=11.56) (6112=18.95) (6113=20.91)		///
	(6114=12.87) (6120=22.21) (6121=21.13) (6122=19.83) (6123=28.04)		///
	(6129=28.04) (6130=17.79) (6200=18.29) (6210=19.78) (6220=16.33)		///
	(6221=17.00) (6222=13.35) (6223=20.69) (6224=11.01) (6300=11.01)		///
	(6310=11.01) (6320=11.01) (6330=11.01) (6340=11.01) (7000=28.53)		///
	(7100=25.39) (7110=25.94) (7111=33.76) (7112=22.57) (7113=23.96)		///
	(7114=21.96) (7115=26.62) (7119=26.92) (7120=25.26) (7121=22.16)		///
	(7122=22.75) (7123=18.02) (7124=27.81) (7125=24.09) (7126=29.16)		///
	(7127=25.26) (7130=23.63) (7131=22.77) (7132=24.49) (7133=30.47)		///
	(7200=29.81) (7210=27.61) (7211=28.03) (7212=28.52) (7213=25.51)		///
	(7214=26.60) (7215=28.60) (7220=29.84) (7221=25.63) (7222=33.16)		///
	(7223=28.70) (7224=33.90) (7230=31.15) (7231=30.78) (7232=47.74)		///
	(7233=31.72) (7234=31.15) (7300=31.00) (7310=30.35) (7311=35.70)		///
	(7312=35.66) (7313=28.12) (7314=24.43) (7315=25.78) (7316=30.14)		///
	(7317=28.95) (7318=28.97) (7319=30.35) (7320=31.50) (7321=35.33)		///
	(7322=30.49) (7323=28.24) (7400=37.34) (7410=36.97) (7411=36.35)		///
	(7412=36.92) (7413=39.45) (7420=41.68) (7421=43.76) (7422=36.92)		///
	(7500=23.97) (7510=23.46) (7511=20.95) (7512=23.57) (7513=27.30)		///
	(7514=22.79) (7515=34.12) (7516=26.96) (7520=23.65) (7521=21.81)		///
	(7522=25.23) (7523=20.78) (7530=22.03) (7531=23.47) (7532=24.88)		///
	(7533=21.24) (7534=22.25) (7535=28.08) (7536=18.07) (7540=43.19)		///
	(7541=27.30) (7542=27.30) (7543=43.19) (7544=55.96) (7549=43.19)		///
	(8000=25.45) (8100=23.41) (8110=31.44) (8111=35.07) (8112=25.11)		///
	(8113=35.82) (8114=26.13) (8120=25.91) (8121=30.32) (8122=22.36)		///
	(8130=29.30) (8131=29.14) (8132=31.34) (8140=25.49) (8141=23.09)		///
	(8142=24.85) (8143=32.67) (8150=16.80) (8151=17.85) (8152=18.03)		///
	(8153=13.24) (8154=16.08) (8155=20.35) (8156=20.35) (8157=16.80)		///
	(8159=21.20) (8160=18.13) (8170=22.40) (8171=27.25) (8172=19.08)		///
	(8180=24.15) (8181=21.13) (8182=23.19) (8183=24.15) (8189=24.16)		///
	(8200=24.93) (8210=24.93) (8211=27.91) (8212=23.88) (8219=24.68)		///
	(8300=26.80) (8310=38.80) (8311=45.76) (8312=29.80) (8320=30.11)		///
	(8321=28.48) (8322=30.34) (8330=25.71) (8331=26.85) (8332=25.95)		///
	(8340=21.08) (8341=13.34) (8342=24.45) (8343=24.80) (8344=18.08)		///
	(8350=37.92) (9000=16.50) (9100=14.64) (9110=14.64) (9111=16.38)		///
	(9112=14.21) (9120=14.57) (9121=14.82) (9122=14.57) (9123=14.57)		///
	(9129=14.57) (9200=11.87) (9210=11.74) (9211=11.74) (9212=11.74)		///
	(9213=11.74) (9214=11.74) (9215=12.01) (9216=12.34) (9300=17.53)		///
	(9310=16.39) (9311=15.35) (9312=17.56) (9313=15.35) (9320=17.55)		///
	(9321=17.55) (9329=16.36) (9330=19.66) (9331=20.27) (9332=16.89)		///
	(9333=17.69) (9334=19.66) (9400=16.50) (9410=16.50) (9411=16.50)		///
	(9412=16.50) (9500=23.43) (9510=13.72) (9520=25.20) (9600=24.07)		///
	(9610=14.39) (9611=14.39) (9612=14.39) (9613=13.87) (9620=27.91)		///
	(9621=25.06) (9622=27.91) (9623=30.99) (9624=27.91) (9629=27.91), gen(isei1)

replace isei=isei1 if isei==. & isei1!=.

reg gincdif isei i.essround [pw=pspwght]
margins, at(isei=(10 90))

reg euftf isei i.essround [pw=pspwght]
margins, at(isei=(10 90))

reg imueclt isei i.essround [pw=pspwght]
margins, at(isei=(10 90))

/* Important note: the analysis of the association between socio-economic status
and political views on the elite level uses two datasets which are not publicly
available. The surveys of Parliamentarians' policy views - the Dutch Parliament
Study - were provided by prof. Rudy Andeweg (andeweg@fsw.leidenuniv.nl); the
database of Parliamentarians' previous occupation was provided by dr. Daphne
van der Pas (d.j.vanderpas@uva.nl). For the purpose of replication, below I
manually generate the variables needed to run the models presented in Table 5.*/

clear
set obs 324
gen id=_n

recode id (1/148=2001) (149/233=2006) (234/324=2017), gen(year)

recode id (1=1110) (2/51 149/174 234/241=1111) (52 53 175 176 242/245=1112)	///
	(54/66 177/182 246/258=1114) (67/78 183/187 259/274=1120) (79 188/190	///
	191=1200) (80=1211) (81 192 275=1212) (82/92 193/199 276/280=1213)		///
	(200=1219) (281=1221) (93 282 283=1222) (284=1321) (94 285=1341)		///
	(95=1342) (286=1343) (201/203 287 288=1345) (96 204=1349) (205=1431)	///
	(97=2211) (98/102 206/210 289/291=2310) (211=2330) (103=2341)			///
	(292=2359) (293 294=2400) (104=2411) (105 106=2412) (212=2420) (107 213	///
	295=2421) (108/124 214/224 296/304=2422) (225=2423) (125 226 227 305	///
	306/308=2432) (126 127 228 309/311=2611) (128=2612) (129 229 312		///
	313=2619) (130=2621) (131 132 314=2633) (133/135 230 315 316=2642)		///
	(136 137=2654) (317 318=2656) (319=3153) (231 320=3334) (138=3341)		///
	(232=3342) (139=3343) (140=3352) (141=3433) (142 321=3435) (143=4110)	///
	(144 145=4120) (322=5152) (233=5164) (323=5321) (146=6111)				///
	(147 148 324=6121), gen(isco)

recode id (149 234 276=1) (2 52 67 68 82 98 104 108 188 189 193 214 246 259	///
	260 261 282 320=2) (1 3/7 54 69 83 94 109 110 150/153 183 184 213		///
	215/217 226 230 233 235 262/264 284 286 289 292 296 297 309=3) (8=3.5)	///
	(23/29 53 55/59 72/74 80 84/86 97 106 112/116 128 129 131 132 138 139	///
	164/167 175 190 197 202 203 208 219 220 227 228 244 250 269 270 275 278	///
	285 293 311 315 318 321=5) (147=5.5) (30/39 60/62 75 76 79 81 87/91 95	///
	101 103 107 117/122 134/136 140 168 180 181 198 209 211 221 222 231 245	///
	251 271 279 280 290 294 302 305 316 324=6) (40/43 63/65 77 78 96 123	///
	137 142 148 169 170 171 176 182 187 192 204 210 223/225 232 240 241 252	///
	253 254 255/258 272/274 288 291 303 304 306/308 313 322 323=7) (44/51	///
	66 92 102 124 127 130 145 146 172/174 191 199 229=.) (else=4), gen(incdif)

recode id (180 190 225 242 310=1) (9 40 60 63 69 75 94 101 137 168 176 210	///
	223 228 231 252 253 269 272 273 316=2) (64=2.5) (10 30/32 41 55 56 61	///
	72 76 79 84 87 88 111/113 117/119 128 134 135 142 150 154 164 181 182	///
	191 198 202 205 208 209 211 215 236 243/245 247 270 274 288 296 305 306	///
	314 322=3) (147=3.5) (3 11 12 23/25 33/35 42 53 57 62 65 70 71 73 77 80	///
	83 85 103 104 109 120 121 123 125 126 131 133 140 148 155/157 165/167	///
	169 175 177 178 188 200 204 206 207 212/214 218 221 226 232 233 235 237	///
	240 241 248 250 254/257 271 275 277/281 284 291 303 311 313 317 321		///
	323=4) (13 132=4.5) (8 28=5.5) (1 2 7 19/21 29 39 68 78 81 91 97 98 100	///
	105 110 116 162 163 184 186 189 192 193 195/197 217 220 222 227 238 239	///
	260 264/267 282 297 300 301 312 315 319 320 324=6) (22 43 82 153 229	///
	230 234 261 268 286 292=7) (44/51 66 92 102 108 124 127 130 145 146 173	///
	174 199 276 294=.) (else=5), gen(integ)

recode id (30 33 36 86 96 117 120 137 148 221 228 236 242 250 269 275 279	///
	288 317 322=1) (14 15 23 26 28 31 40 52 53 60 62/64 76 78 79 81 87 99	///
	103 107 116 118 119 128 134 140 142 162 186 201 213 225 235 237 244 245	///
	258 262 272 277 294 305 314 316=2) (132 147=2.5) (2 4 11 16 17 19 20 22	///
	24 27 34 54 55 58 59 68 70 72 75 77 80 83/85 88/91 95 101 112 114 121	///
	122 126 135 136 138 141 154 155 158 159 165 166 169 170 177 185 187 195	///
	196 198 204 210 218 226 229 231 238 240 247 249 252/255 280 284 293 302	///
	311=3) (35 94=3.5) (44=4.5) (6 8 21 29 37 39 56 82 93 98 105 109 113	///
	115 149 152	153 156 171 175 183 184 188 203 207 215 216 219 227 241 264	///
	266 268 285 290 295 296 301 307 319 320=5) (108=5.5) (32 41 43 129 143	///
	161 189 248 257 263 267 271 281 286 291 304 313 318 324=6) (38 42 123	///
	157 172 191 192 202 224 230 234 246 251 260 261 270 287 289 292 303 308	///
	309 310 323=7) (45/51 66 92 102 124 127 130 145 146 173 174 199 212 276	///
	297=.) (else=4) , gen(eu)

recode isco (1110=74.50) (1111=68.77) (1112=78.76) (1114=71.29)				///
	(1120=70.34) (1200=72.94) (1211=73.38) (1212=74.79) (1213=70.57)		///
	(1219=68.54) (1221=71.39) (1222=75.25) (1321=65.42) (1341=65.01)		///
	(1342=65.01) (1343=65.01) (1345=65.01) (1349=65.01) (1431=51.01)		///
	(2211=88.70) (2310=85.41) (2330=82.41) (2341=76.49) (2359=66.42)		///
	(2400=73.91) (2411=76.65) (2412=75.50) (2420=70.09) (2421=70.09)		///
	(2422=72.94) (2423=68.55) (2432=73.91) (2611=86.72) (2612=88.96)		///
	(2619=81.05) (2621=77.19) (2633=83.81) (2642=72.83) (2654=63.31)		///
	(2656=54.00) (3153=73.71) (3334=62.39) (3341=62.13) (3342=57.99)		///
	(3343=54.55) (3352=67.11) (3433=50.15) (3435=50.15) (4110=43.33)		///
	(4120=44.94) (5152=32.20) (5164=30.59) (5321=26.64) (6111=11.56)		///
	(6121=21.13), gen(isei)

label var incdif "Income differences (preferences)"
label var integ "Migrant integration (preferences)"
label var eu "EU unification (preferences)"
label var isei "Socio-economic status"

reg incdif isei i.year
margins, at(isei=(50 90))

reg eu isei i.year
margins, at(isei=(50 90))

reg integ isei i.year
margins, at(isei=(50 90))
